﻿<UserControl
    x:Class="WinKee.Controls.MainEntrySection"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:models="using:WinKee.Models"
    mc:Ignorable="d"
    d:DesignHeight="600"
    d:DesignWidth="400" d:DataContext="{d:DesignInstance models:PasswordEntry}">

    <ScrollViewer>
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="MainGroup">
                <VisualState x:Name="PasswordState">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                                           Storyboard.TargetName="PasswordTextBox">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="TextboxState">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)"
                                                           Storyboard.TargetName="PasswordBox">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <StackPanel Orientation="Vertical">
           
            <TextBlock FontSize="26" Text="Title" />
            <TextBlock Text="{Binding Title}" TextWrapping="Wrap" Foreground="{StaticResource PhoneAccentBrush}"
                       FontSize="36" />
            <TextBlock FontSize="26" Text="Username" />
            <TextBox Background="{StaticResource PhoneChromeBrush}" Name="UsernameTextBox" IsReadOnly="True"
                     Text="{Binding UserName}" TextWrapping="Wrap" Foreground="{StaticResource PhoneAccentBrush}"
                     FontSize="30" />
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <TextBlock FontSize="26" Text="Password" VerticalAlignment="Center" />
                <CheckBox Unchecked="DisplayPasswordCheckBoxOnUnchecked" Name="DisplayPasswordCheckBox" Grid.Column="1"
                          Content="Display password" Checked="DisplayPasswordCheckBoxOnChecked" />
            </Grid>

            <PasswordBox Background="{StaticResource PhoneChromeBrush}" Name="PasswordBox" Password="{Binding Password}"
                         IsEnabled="False" />
            <TextBox Background="{StaticResource PhoneChromeBrush}" Name="PasswordTextBox" IsReadOnly="True"
                     Text="{Binding Password}" TextWrapping="Wrap" Foreground="{StaticResource PhoneAccentBrush}"
                     FontSize="30" />
        </StackPanel></ScrollViewer>
</UserControl>
